package com.fram.service.api.v1.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fram.bean.api.advertising.request.AdvertisingDisplaySearchRequest;
import com.fram.bean.api.advertising.response.AdvertisingDisplaySearchResponse;
import com.fram.common.canstant.ErrCode;
import com.fram.common.exception.ProException;
import com.fram.common.exception.ProValiDataException;
import com.fram.mapper.SysAdvertisingDisplayMapper;
import com.fram.service.api.v1.AdvertisingDisplayService;

/**
 * @作者： 陳曉鬆 @时间： 2020年6月1日 - 上午9:32:48 @description：->
 */
@Service("advertisingDisplayService")
public class AdvertisingDisplayServiceImpl implements AdvertisingDisplayService {

	@Autowired
	private SysAdvertisingDisplayMapper advertisingDisplayMapper;

	@Override
	public List<AdvertisingDisplaySearchResponse> list(AdvertisingDisplaySearchRequest request) throws ProException {
		List<AdvertisingDisplaySearchResponse> list = advertisingDisplayMapper.listForApi(request);
		if (list == null || list.size() == 0) {
			throw new ProValiDataException(ErrCode.NO_DATA.getReturnCode(), ErrCode.NO_DATA.getReturnMsg());
		}
		return list;
	}

}
